package stoppuhr;
import java.awt.EventQueue;


public class Ticker extends Thread{
	//Milliseconds
	private final static long UPDATE_INTETRVAL = 10;
	private UpdateRequest updateReq;	// update Request
	
	public Ticker(Clock clock){
		updateReq = new UpdateRequest(clock);
	}
	public void run(){
		try{
			while(!isInterrupted()){
				EventQueue.invokeLater(updateReq);
				Thread.sleep(UPDATE_INTETRVAL); 
			}
		}catch( InterruptedException e){
			System.out.println("Stoppuhr unterbrochen\n");
		}
	}
}
